﻿using System.Web.Mvc;

namespace Kaiser.MvcBase.Route
{
    public abstract class AreaRegistrationBase : AreaRegistration
    {
        public override string AreaName
        {
            get {
                var item = GetType().Name;
                return item.Replace("AreaRegistration", "");
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
             context.MapLowerCaseUrlRoute(
             AreaName + "_default",
             AreaName.ToLower() + "/{controller}/{action}/{id}",
             new { action = "Index", id = UrlParameter.Optional }
             );
        }
    }
}